package com.boat.framework.common.monitor.event;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

/**
 * pulsar消息发送失败
 * 
 * 羽嘉框架已自动埋点，业务系统无需开发
 * 
 * @author 周江
 *
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
public class PulsarMsgSendFailed extends BaseMonitorEvent {
//	/**
//	 * topic
//	 */
//	private String topic;
	/**
	 * 消息message
	 */
	private String message;

	/**
	 * 异常类型
	 */
	private String exceptionType;
	/**
	 * 异常消息
	 */
	private String exceptionMsg;
	/**
	 * 异常描述
	 */
	private String remark;

	public PulsarMsgSendFailed() {
		super();
	}

	public PulsarMsgSendFailed(String topic, String message, Exception ex) {
		super();
		setName(topic);
		
		//设置属性
//		setTopic(topic);
		setMessage(message);
		setExceptionType(
				ex.getCause() != null ? ex.getCause().getClass().getSimpleName() : ex.getClass().getSimpleName());
		setExceptionMsg(ex.getCause() != null ? ex.getCause().getMessage() : ex.getMessage());
		setRemark("消息发送失败");
	}

}
